package com.leancloud.circle.adapter;

import com.avos.avoscloud.AVObject;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

public class AnswerAdapter extends BaseQuickAdapter<AVObject, BaseViewHolder> {

    public AnswerAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, final AVObject item) {

//        helper.itemView.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                ARouter.getInstance().build(CIRCLE_ANSWER_DETAILS)
//                        .withString("answerId", item.getObjectId())
//                        .greenChannel()
//                        .navigation();
//            }
//        });
//
//        ImageView headImg = helper.itemView.findViewById(R.id.answer_item_head_img);
//
//        AVUser circleUser = item.getAVUser(TARGET_AV_USER);
//
//        String nikeName = circleUser.getString(USER_NICK_NAME);
//        String headIcon = circleUser.getString(USER_HEAD_ICON);
//        String date = DateUtil.formatDate(item.getCreatedAt(), FORMAT_5);
//
//        GlideManager.loadCircleImg(headIcon, headImg, R.mipmap.icon_default_head);
//        helper.setText(R.id.answer_item_name_tx, nikeName);
//        helper.setText(R.id.answer_item_date_tx, date);
//        helper.setText(R.id.answer_item_issue, item.getString(ISSUE_CONTENT));
//        helper.setText(R.id.answer_item_reply_count_tx, item.getInt(ISSUE_REPLY_COUNT) + "人已回答");
//
//        helper.itemView.findViewById(R.id.answer_item_reply_tx).setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                ARouter.getInstance().build(CIRCLE_REPLY)
//                        .withString("answerId", item.getObjectId())
//                        .greenChannel()
//                        .navigation();
//            }
//        });
    }
}
